
function deepCopy (o) {
  if (o === null) return '';
  if (o.constructor === Array) {
    let n = [];
    for (let i = 0; i < o.length; ++i) {
      n[i] = deepCopy(o[i]);
    }
    return n;
  } else if (o.constructor === Object) {
    let n = {};
    for (let i in o) {
      if (o.hasOwnProperty(i)) {
        n[i] = deepCopy(o[i]);
      }
    }
    return n;
  } else {
    return o;
  }
}

export default deepCopy;
